package com.yuexunit.operationman.nbsy.module.Patients.model.impl;

import com.yuexunit.operationman.nbsy.Api.Api;
import com.yuexunit.operationman.nbsy.module.OperationBeforeAndAfter.bean.BeforeAndAfterBean;
import com.yuexunit.operationman.nbsy.module.Patients.model.IPatientModel;
import com.yuexunit.operationman.nbsy.util.ApiUtil;

import java.util.ArrayList;

import rx.Observable;

/**
 * Created by Administrator on 2018/1/26 0026.
 */

public class PatientModel implements IPatientModel{
    Api api;

    public  Api getApiInstance() {
        if(api!=null) {
            return api;
        }else{
            api= ApiUtil.getInstance().createRetrofitApi(Api.class);
            return api;
        }
    }

    @Override
    public Observable<ArrayList<BeforeAndAfterBean.ObjectEntity>> getPatientList() {
        api=getApiInstance();
        return api.getPatientList();
    }
}
